#include <modules\audio\audio_module.h>

namespace DelGE
{
	namespace Modules
	{
		namespace Audio
		{
			AudioModule::AudioModule()
			{
				this->sName = "audio";
				this->LoadModule();
			}

			AudioModule::~AudioModule()
			{
				this->sName = "";
				this->UnloadModule();
			}

			void AudioModule::LoadModule()
			{
				this->pFMod_AudioInterface = new FModAudioInterface();
			}

			void AudioModule::UnloadModule()
			{
				delete this->pFMod_AudioInterface;
			}

			FModAudioInterface* AudioModule::GetInterface_FMod()
			{
				return this->pFMod_AudioInterface;
			}

			Sound* AudioModule::LoadSound(string sFilepath)
			{
				return ((AudioInterface*)this->pInterface)->LoadSound(sFilepath);
			}

			Music* AudioModule::LoadMusic(string sFilepath)
			{
				return ((AudioInterface*)this->pInterface)->LoadMusic(sFilepath);
			}

			void AudioModule::UnloadMusic(Music* pAudioMusic)
			{
				((AudioInterface*)this->pInterface)->UnloadMusic(pAudioMusic);
			}

			void AudioModule::UnloadSound(Sound* pAudioSound)
			{
				((AudioInterface*)this->pInterface)->UnloadSound(pAudioSound);
			}

			void AudioModule::Update()
			{
				((AudioInterface*)this->pInterface)->Update();
			}
		}
	}
}